package com.java110.mall.openapi.bmo.impl;

import com.alibaba.fastjson.JSONObject;
import com.java110.core.context.ICmdDataFlowContext;
import com.java110.mall.openapi.bmo.IMallCommonApiBmo;
import com.java110.utils.cache.MappingCache;
import com.java110.utils.constant.MappingConstant;
import com.java110.vo.ResultVo;
import org.springframework.stereotype.Service;

@Service("getMallConfig")
public class GetMallConfigBmoImpl implements IMallCommonApiBmo {
    @Override
    public void validate(ICmdDataFlowContext context, JSONObject reqJson) {

    }

    @Override
    public void doCmd(ICmdDataFlowContext context, JSONObject reqJson) {

        String platformMchId = MappingCache.getValue(MappingConstant.WECHAT_STORE_DOMAIN, "mchId");
        String platformMchName = MappingCache.getValue(MappingConstant.WECHAT_STORE_DOMAIN, "mchName");
        String key = MappingCache.getValue(MappingConstant.WECHAT_STORE_DOMAIN, "key");
        JSONObject paramOut = new JSONObject();
        paramOut.put("platformMchId", platformMchId);
        paramOut.put("platformMchName",platformMchName);
        paramOut.put("platformKe",key);

        context.setResponseEntity(ResultVo.createResponseEntity(paramOut));
    }
}
